{% extends "teacher/teacher_header.html" %}
{% block context %}
    <div class="page_header">
        <h3 align="center">教师选课</h3>
    </div>
    <div class="container">
        <table class="table table-hover">
            <tr>
                <th scope="col">课程名称</th>
                <th scope="col">专业编号</th>
                <th scope="col">年级</th>
                <th scope="col">时间</th>
                <th scope="col">选择</th>
            </tr>
            </thead>
            <tbody>
            {% for course in courses %}
                <tr>
                    <td>{{ course.course_name }}</td>
                    <td>{{ course.major_id }}</td>
                    <td>{{ course.grade }}</td>
                    <td>{{ course.time }}</td>
                    <td><button type="submit" class="btn btn-danger" onclick="window.location.href='/teacher_choose_order?course_id={{ course.course_id }}'">选择</button></td>
                </tr>
            {% empty %}
                <div class="alert alert-danger" role="alert">
                    <strong>警告</strong>
                    你没有可以选择的课程，请确认是否已经选过 
                </div>
            {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock context %}